import request from '@/utils/request'

export function getSysUserPage(query) {
  return request({
    url: '/api/system/user/listPage',
    method: 'post',
    data: query
  })
}

export function getSysUserList(query) {
  return request({
    url: '/api/system/user/list',
    method: 'post',
    data: query
  })
}

export function updatePersonalInfo(form) {
  return request({
    url: '/api/system/user/updatePersonalInfo',
    method: 'post',
    data: form
  })
}

export function saveSysUser(form) {
  return request({
    url: '/api/system/user/save',
    method: 'post',
    data: form
  })
}

export function deleteSysUser(id) {
  return request({
    url: '/api/system/user/delete',
    method: 'post',
    data: { id: id }
  })
}

export function getSysUserById(id) {
  return request({
    url: '/api/system/user/getById',
    method: 'post',
    data: { id: id }
  })
}

export function uploadLogo(file) {
  debugger
  const formData = new FormData()
  formData.append('file', file.file)
  return request({
    url: '/api/uplaod/images/saveImage',
    method: 'post',
    data: formData
  })
}
